package com.JingYan.util;


import com.JingYan.enums.BaseEnums;

/**
 *枚举工具类
 * @author itdev05
 */
@Deprecated
public class EnumUtil {
    public static <T extends BaseEnums> String getLabelByValue(Class<T> enumClass, String code) {
        for (T each : enumClass.getEnumConstants()) {
            if (each.getCode().equals(code)) {
                return each.getInfo();
            }
        }
        return "";
    }

    public static <T extends BaseEnums> String getLabelByInfo(Class<T> enumClass, String info) {
        for (T each : enumClass.getEnumConstants()) {
            if (each.getInfo().equals(info)) {
                return each.getCode();
            }
        }
        return "";
    }
}
